<div>
	<ul class="breadcrumb">
        <li>My Account</li>
        <li class="active">Deposit Ticket</li>
    </ul>
    <div class="products_list products_slider" style="margin-top:20px;">
		<table>
			<tr>
				<td class="align_left fl_left" style="margin-left:20px;font-size:20px;">
					<h2>Bank</h2>
				</td>
				<td>
					<div class="input-box fl_left" style="margin-left:20px;">
						<select id="topupdeposit_bank" name="topupdeposit_bank" style="border:solid 1px #d7d7d7; padding:2px; font-size:15px; color:#818181; width:208px;">
							<?php 
								if($data_bank !== ''){
									foreach($data_bank as $row_bank){
										echo "<option value='". $row_bank->bank_id ."'>". $row_bank->bank_name ."</option>";
									}
								}
							?>
						</select>
					</div>
				</td>
			</tr>
			<tr>
				<td class="align_left fl_left" style="margin-left:20px;font-size:20px;">
					<br>
					<h2>Jumlah Rupiah</h2>
				</td>
				<td>
					<div class="input-box fl_left" style="margin-left:20px;">
						Rp. <input type="text" id="topupdeposit_jumlah" class="general_inputtext" style="height:20px;width:178px;text-align:right;">
					</div>
				</td>
			</tr>  
			<tr>
				<td colspan="2" align="center">
					</br>
					<button type="button" onClick="generate()" id="button_generate" class="general_button" style="margin-left:20px;margin-top:20px;">Get Ticket</button>
				</td>
			</tr>
		</table>
		<br><br><br><br>
		<div class="cart_table" id="ticket_response">
			<!--<h2 style="font-size:20px;">Request anda berhasil.</h2><br>
			<h2 style="font-size:20px;">Silahkan mentransfer sebesar : Rp. <label id="nominal_totransfer"></label></h2>
			<h2 style="font-size:20px;">Kode Request : <label id="kode_request"></label></h2>-->
			<p style="font-size:20px;">
				Kode request <label id="kode_request"></label>, silakan transfer sebesar Rp. <label id="nominal_totransfer"></label> ke Rekening <label id="request_bank"></label>. Setelah transfer, konfirmasikan pada halaman Deposit Confirm.
			</p>
		</div>
    </div>
	<script type="text/javascript">
		var generate = null;
	</script>
	<script>
	$(document).ready(function(){
		$("#ticket_response").hide();
		function generating(){
			var jumlah = $("#topupdeposit_jumlah").val();
			var bank = $("#topupdeposit_bank").val();
			$.ajax({
				url : 'index.php/c_topupdeposit/generate',
				type : 'POST',
				data : {
					jumlah : jumlah,
					bank : bank,
				},success : function(msg){
					var obj = jQuery.parseJSON(msg);
					$("#ticket_response").show();
					$("#nominal_totransfer").text(obj.kode);
					$("#kode_request").text(obj.kode);
					$("#request_bank").text(obj.rekening);
				}
			});
		}
		generate = generating;
		$("#button_submitsearch").click(function(){
			var keyword = $(".form-search").find('input').val();
			my_config.main.load('index.php/c_search?key=' + keyword);
		});
	});
	</script>
</div>